/**
 * @description 统一返回结果的模型
 * @author LI
 */

 /**
  * 基础返回结果模块
  */
class BaseModel {
  constructor({ total, rows, success, msg }) {
    this.success = success
    this.total = total
    this.msg = msg
    this.rows = rows
  }
}

/**
 * 返回结果的数据模型，失败和成功都需要这个模型
 */
class ReturnResult extends BaseModel{
  constructor(total = 0, rows = null, success, msg) {
    super({
      total,
      rows,
      success,
      msg
    })
  }
}

module.exports = {
  ReturnResult
}
